//
//  ViewController.m
//  BinaryConversionTool
//
//  Created by onepiece on 2019/4/29.
//  Copyright © 2019 onepiece. All rights reserved.
//

#import "ViewController.h"
#import "LSDBinaryConversionTool.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    size_t charSize = sizeof(char);
    NSLog(@"charSize = %zu", charSize);
    
    size_t shortSize = sizeof(short);
    NSLog(@"shortSize = %zu", shortSize);
    
    size_t intSize = sizeof(int);
    NSLog(@"intSize = %zu", intSize);
    
    size_t longSize = sizeof(long);
    NSLog(@"longSize = %zu", longSize);
    
    size_t floatSize = sizeof(float);
    NSLog(@"floatSize = %zu", floatSize);
    
    size_t doubleSize = sizeof(double);
    NSLog(@"doubleSize = %zu", doubleSize);

    
}

- (IBAction)btnClick:(UIButton *)sender {
//    Byte bytes[4] = {0};
//    IntToByteArray(3000, bytes);
//    int result = ByteArrayToInt(bytes);
//    NSLog(@"result = %d",result);
//
//    NSString *hexStr = [LSDBinaryConversionTool getHexByDecimal:[NSDecimalNumber decimalNumberWithString:@"1000000"]];
//    NSLog(@"hexStr = %@",hexStr);
//
//    long long dec =  [LSDBinaryConversionTool getDecimalByHex:hexStr];
//    NSLog(@"dec:%lld",dec);
    
    NSString *hex = [LSDBinaryConversionTool hexStringFromString:@"我爱你"];
    NSLog(@"hex = %@",hex);

    NSString *str = [LSDBinaryConversionTool stringFromHexString:hex];
    NSLog(@"str = %@",str);
}


@end
